<?php $this->load->view('include/header'); ?>

<?php echo anchor('admin/listuser/'.'student','Student'); ?>
<?php echo anchor('admin/listuser/'.'teacher','Teacher'); ?>
<?php echo anchor('admin/listuser/'.'admin','Admin'); ?>

<?php 
	echo "<table border='1'>
	<tr>
	<th>Name</th>
	<th>Email</th>
	<th> </th>
	</tr>";
	foreach($rows as $r){
		if ($r){
			echo "<tr>";
			echo '<td>'.$r->firstname.' '.$r->lastname.'</td>';
			echo '<td>'.$r->email.'</td>';
			echo '<td>'.anchor('admin/delete/'.$r->user_id,'Delete').'</td>';
			echo "</tr>";	
		}
		else 	
			echo '<p>'."No topic is avaiable".'</p>';
	}
	echo "</table>";
	if ($check == 1)
		echo anchor('admin/addUser','Create new student');
	else if ($check == 2)
		echo anchor('admin/addUser','Create new teacher');
	else if ($check == 3)
		echo anchor('admin/addUser','Create new admin');
	else 
		echo anchor('admin/addUser','Create new user');
	$this->session->set_userdata('checkType',$check);
?>

<?php $this->load->view('include/footer'); ?>
